﻿using GrainManage.Entities.Contact;
using GrainManage.Proxy.Util;
using System.Reflection;

namespace GrainManage.Proxy
{
    public sealed class ContactProxy : GrainManage.Interface.IContact
    {

        //************************************************POST************************************************

        public OutputSearchName SearchName(InputSearchName input)
        {
            var result = WebUtil.ExecuteByPost<OutputSearchName>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputSearchArea SearchArea(InputSearchArea input)
        {
            var result = WebUtil.ExecuteByPost<OutputSearchArea>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputSearchAddress SearchAddress(InputSearchAddress input)
        {
            var result = WebUtil.ExecuteByPost<OutputSearchAddress>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        //public OutputGetContactsWithPhoto GetContactsWithPhoto(InputGetContactsWithPhoto input)
        //{
        //    var result = WebUtil.ExecuteByPost<OutputGetContactsWithPhoto>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
        //    return result;
        //}

        public OutputGetByID GetByID(InputGetByID input)
        {
            var result = WebUtil.ExecuteByPost<OutputGetByID>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputSearch Search(InputSearch input)
        {
            var result = WebUtil.ExecuteByPost<OutputSearch>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputInsert Insert(InputInsert input)
        {
            var result = WebUtil.ExecuteByPost<OutputInsert>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputUpdate Update(InputUpdate input)
        {
            var result = WebUtil.ExecuteByPost<OutputUpdate>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputDelete Delete(InputDelete input)
        {
            var result = WebUtil.ExecuteByPost<OutputDelete>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchInsert BatchInsert(InputBatchInsert input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchInsert>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchUpdate BatchUpdate(InputBatchUpdate input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchUpdate>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }

        public OutputBatchDelete BatchDelete(InputBatchDelete input)
        {
            var result = WebUtil.ExecuteByPost<OutputBatchDelete>(UrlUtil.Generate(MethodBase.GetCurrentMethod()), input);
            return result;
        }



    }
}
